dreem
  • Overview

DREEM

  • Installation
  • Examples
  • API Reference
  • I/O files
  • Formats
  • Dependencies
  • Download a test dataset
  • Logging

Plots

  • Get started
  • Gallery
    • Base coverage
    • Compare mutation profiles
    • DeltaG vs sub rate
    • Experimental variable across samples
    • Mutation fraction
    • Mutation fraction delta
    • Mutation fraction identity
    • Mutation per read per reference
    • Mutations in barcodes
    • Mutations per read per sample
    • Num aligned reads per reference frequency distribution
  • Write your own plots

Modules

  • Alignment
  • Vectorization
  • Aggregation
  • Drawing (CLI)
  • Clustering
  • Demultiplexing

About

  • DMS-MaPseq
  • DREEM
  • About
dreem
  • Gallery
  • View page source

Gallery

Base coverage

Plot the base coverage of a single row of your dataframe.

DOCSTRING: base_coverage
dreem.draw.study.Study.base_coverage(*args, **kwargs)

Plot the base coverage of a single row of your dataframe.

Parameters
  • sample (str, optional) – Selects this sample. Defaults to None.

  • reference (str, optional) – Selects this reference. Defaults to None.

  • section (str, optional) – Selects this section. Defaults to full.

  • cluster (str, optional) – Selects this cluster. Defaults to pop_avg.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Compare mutation profiles

Plot the mutation fraction of multiple mutation profiles.

DOCSTRING: compare_mutation_profiles
dreem.draw.study.Study.compare_mutation_profiles(*args, **kwargs)

Plot the mutation fraction of multiple mutation profiles.

Parameters
  • max_plots – maximum number of plots to show.

  • max_axis – maximum value of the x and y axis. If None, the maximum value of the data will be used if above 0.15, otherwise 0.15.

  • sample (list, str, optional) – Filter rows by sample (a list of samples or just a sample). Defaults to None.

  • reference (list, str, optional) – Filter rows by reference (a list of references or just a reference). Defaults to None.

  • section (list, str, optional) – Filter rows by section (a list of sections or just a section). Defaults to None.

  • cluster (list, str, optional) – Filter rows by cluster (a list of clusters or just a cluster). Defaults to None.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

DeltaG vs sub rate

Plot the Mutation fraction of each paired-expected base of the ROI for each reference of a sample, w.r.t the deltaG estimation.

DOCSTRING: deltaG_vs_sub_rate
dreem.draw.study.Study.deltaG_vs_sub_rate(*args, **kwargs)

Plot the Mutation fraction of each paired-expected base of the ROI for each reference of a sample, w.r.t the deltaG estimation.

Parameters
  • models (List[str], optional) – Models to fit on the data using scipy.optimize.curve_fit. Under the form 'lambda x, a, b: a*x+b' where x is the variable. Defaults to [].

  • sample (list, str, optional) – Filter rows by sample (a list of samples or just a sample). Defaults to None.

  • reference (list, str, optional) – Filter rows by reference (a list of references or just a reference). Defaults to None.

  • section (list, str, optional) – Filter rows by section (a list of sections or just a section). Defaults to None.

  • cluster (list, str, optional) – Filter rows by cluster (a list of clusters or just a cluster). Defaults to None.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Experimental variable across samples

Plot a given experimental variable vs Mutation fraction across samples for a given reference and section.

DOCSTRING: experimental_variable_across_samples
dreem.draw.study.Study.experimental_variable_across_samples(*args, **kwargs)

Plot a given experimental variable vs Mutation fraction across samples for a given reference and section.

Parameters
  • experimental_variable (str) – Name of the experimental variable to plot.

  • models (List[str], optional) – Models to fit on the data using scipy.optimize.curve_fit. Under the form 'lambda x, a, b: a*x+b' where x is the variable. Defaults to [].

  • sample (list, str, optional) – Filter rows by sample (a list of samples or just a sample). Defaults to None.

  • reference (list, str, optional) – Filter rows by reference (a list of references or just a reference). Defaults to None.

  • section (list, str, optional) – Filter rows by section (a list of sections or just a section). Defaults to None.

  • cluster (list, str, optional) – Filter rows by cluster (a list of clusters or just a cluster). Defaults to None.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Mutation fraction

Plot the mutation rates as histograms.

DOCSTRING: mutation_fraction
dreem.draw.study.Study.mutation_fraction(*args, **kwargs)

Plot the mutation rates as histograms.

Parameters
  • show_ci (bool, optional) – Show confidence intervals. Defaults to True.

  • sample (str, optional) – Selects this sample. Defaults to None.

  • reference (str, optional) – Selects this reference. Defaults to None.

  • section (str, optional) – Selects this section. Defaults to full.

  • cluster (str, optional) – Selects this cluster. Defaults to pop_avg.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Mutation fraction delta

Plot the Mutation fraction difference between two mutation profiles.

DOCSTRING: mutation_fraction_delta
dreem.draw.study.Study.mutation_fraction_delta(*args, **kwargs)

Plot the Mutation fraction difference between two mutation profiles.

Parameters
  • sample1 – sample of the first mutation profile.

  • sample2 – sample of the second mutation profile.

  • reference1 – reference of the first mutation profile.

  • reference2 – reference of the second mutation profile.

  • section1 – section of the first mutation profile.

  • section2 – section of the second mutation profile.

  • cluster1 – cluster of the first mutation profile.

  • cluster2 – cluster of the second mutation profile.

  • base_index1 – base index of the first mutation profile.

  • base_index2 – base index of the second mutation profile.

  • base_type1 – base type of the first mutation profile.

  • base_type2 – base type of the second mutation profile.

  • base_pairing1 – base pairing of the first mutation profile.

  • base_pairing2 – base pairing of the second mutation profile.

Returns

{‘fig’: a plotly figure, ‘data’: a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Mutation fraction identity

Plot the mutation rates as histograms.

DOCSTRING: mutation_fraction_identity
dreem.draw.study.Study.mutation_fraction_identity(*args, **kwargs)

Plot the mutation rates as histograms.

Parameters
  • show_ci (bool, optional) – Show confidence intervals. Defaults to True.

  • sample (str, optional) – Selects this sample. Defaults to None.

  • reference (str, optional) – Selects this reference. Defaults to None.

  • section (str, optional) – Selects this section. Defaults to full.

  • cluster (str, optional) – Selects this cluster. Defaults to pop_avg.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Mutation per read per reference

Plot the number of mutations per read per reference as an histogram.

DOCSTRING: mutation_per_read_per_reference
dreem.draw.study.Study.mutation_per_read_per_reference(*args, **kwargs)

Plot the number of mutations per read per reference as an histogram.

Parameters
  • sample (str, optional) – Selects this sample. Defaults to None.

  • reference (str, optional) – Selects this reference. Defaults to None.

  • section (str, optional) – Selects this section. Defaults to full.

  • cluster (str, optional) – Selects this cluster. Defaults to pop_avg.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Mutations in barcodes

Plot the number of mutations in the barcode per read of a sample as an histogram.

DOCSTRING: mutations_in_barcodes
dreem.draw.study.Study.mutations_in_barcodes(*args, **kwargs)

Plot the number of mutations in the barcode per read of a sample as an histogram.

Parameters
  • sample (list, str, optional) – Filter rows by sample (a list of samples or just a sample). Defaults to None.

  • reference (list, str, optional) – Filter rows by reference (a list of references or just a reference). Defaults to None.

  • section (list, str, optional) – Filter rows by section (a list of sections or just a section). Defaults to None.

  • cluster (list, str, optional) – Filter rows by cluster (a list of clusters or just a cluster). Defaults to None.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Mutations per read per sample

Plot the number of mutations per read per sample as an histogram.

DOCSTRING: mutations_per_read_per_sample
dreem.draw.study.Study.mutations_per_read_per_sample(*args, **kwargs)

Plot the number of mutations per read per sample as an histogram.

Parameters
  • sample (list, str, optional) – Filter rows by sample (a list of samples or just a sample). Defaults to None.

  • reference (list, str, optional) – Filter rows by reference (a list of references or just a reference). Defaults to None.

  • section (list, str, optional) – Filter rows by section (a list of sections or just a section). Defaults to None.

  • cluster (list, str, optional) – Filter rows by cluster (a list of clusters or just a cluster). Defaults to None.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Num aligned reads per reference frequency distribution

Plot the number of aligned reads per reference as a frequency distribution. x axis is the number of aligned reads per reference, y axis is the count of reference that have this number of aligned reads.

DOCSTRING: num_aligned_reads_per_reference_frequency_distribution
dreem.draw.study.Study.num_aligned_reads_per_reference_frequency_distribution(*args, **kwargs)

Plot the number of aligned reads per reference as a frequency distribution. x axis is the number of aligned reads per reference, y axis is the count of reference that have this number of aligned reads.

Parameters
  • sample (list, str, optional) – Filter rows by sample (a list of samples or just a sample). Defaults to None.

  • reference (list, str, optional) – Filter rows by reference (a list of references or just a reference). Defaults to None.

  • section (list, str, optional) – Filter rows by section (a list of sections or just a section). Defaults to None.

  • cluster (list, str, optional) – Filter rows by cluster (a list of clusters or just a cluster). Defaults to None.

  • base_index (list, int, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base index, using 1-indexing. Can be a unique sequence in the row’s sequence, a list of indexes or a single index. Gives a Defaults to None.

  • base_type (list, str, optional) – Filter per-base attributes (sub_rate, sequence, etc) by base type. Defaults to ['A','C','G','T'].

  • base_pairing (bool, optional) – Filter per-base attributes (sub_rate, sequence, etc) by expected base pairing. True will keep only base pairs, False will keep only non-base pairs. Defaults to None.

  • **kwargs – Additional arguments to pass to filter rows by. Ex: flank='flank_1' will keep only rows with flank==flank_1.

Returns

{'fig': a plotly figure, 'data': a pandas dataframe}

Return type

dict

to_html (str, optional): File name to save the figure as a html.

to_png (str, optional): File name to save the figure as a png.

Previous Next

© Copyright 2023, Rouskin Lab.

Built with Sphinx using a theme provided by Read the Docs.